/*
 * @Author: 9ilk 3535851673@qq.com
 * @Date: 2025-01-04 18:46:19
 * @LastEditors: 9ilk 3535851673@qq.com
 * @LastEditTime: 2025-01-05 15:08:59
 * @FilePath: /zhuang/ThreadPool/ThreadPool.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include "ThreadPool.hpp"
#include <memory>
#include"Task.hpp"
using namespace std;
using namespace ThreadPoolModule;

int main()
{
    ENABLE_FILE_LOG();
    // ENABLE_CONSOLE_LOG();
    unique_ptr<ThreadPool<task_t>> tp = make_unique<ThreadPool<task_t>>();
    tp->Start(); // 线程池启动
    int cnt = 10;
    while(cnt)
    {
      tp->Enqueue(Push); //线程池任务入队列
      cnt--; 
      sleep(1);
    }
    tp->Stop(); //线程池停止
    sleep(3);
    tp->Wait(); //线程回收
    return 0;
}
